﻿using Longbow.Logging;
using System.Collections.Specialized;

namespace System
{
    /// <summary>
    /// 异常记录日志操作扩展类
    /// </summary>
    public static class ExceptionExtensions
    {
        /// <summary>
        /// 异常写入日志方法 内部调用 ExceptionManager.Publish (NETCore) 调用 InternalEventLogWriter (NET Framework)
        /// </summary>
        /// <param name="ex">Exception 实例</param>
        /// <param name="nv">日志附属信息</param>
        public static void Log(this Exception ex, NameValueCollection nv = null)
        {
            ExceptionManager.Publish(ex, nv);
        }
    }
}
